package com.hengyi.pda.adapter;

import android.content.Context;

import com.common.retrofit.ShuangTu.QueryResultBean;
import com.common.utils.EmptyUtils;
import com.common.widget.recyclerview.refresh.adapter.CommonAdapter;
import com.common.widget.recyclerview.refresh.adapter.ViewHolder;
import com.hengyi.pda.R;

import java.util.List;

public class ScanAdapter extends CommonAdapter<QueryResultBean.TablesBean.TNOTICEBean> {

    public ScanAdapter(Context context, List<QueryResultBean.TablesBean.TNOTICEBean> data) {
        super(context, data);
    }

    @Override
    protected void convert(ViewHolder holder, QueryResultBean.TablesBean.TNOTICEBean item, int position) {
                holder.setText(R.id.tv_need_weight,"应扫："+item.WEIGHT+" KG");
                holder.setText(R.id.tv_guanse,"管色："+item.COLOR);
                if(EmptyUtils.isEmpty(item.SCAN_WEIGHT)){
                    holder.setText(R.id.tv_yisao,"已扫：0.00 KG");
                }else {
                    holder.setText(R.id.tv_yisao,"已扫："+item.SCAN_WEIGHT+" KG");
                }


    }

    @Override
    protected int getItemViewLayoutId(int position, QueryResultBean.TablesBean.TNOTICEBean item) {
        return R.layout.item_scan;
    }
}
